package com.cyzy.controller;

import com.cyzy.dto.ResponseDto;
import com.cyzy.pojo.Coupon;
import com.cyzy.pojo.UserCoupons;
import com.cyzy.service.CouponService;
import com.cyzy.service.UserCouponsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/coupon")
public class CouponController {

    @Autowired
    private CouponService couponService;

    @Autowired
    private UserCouponsService userCouponsService;

    @GetMapping("selectCoupon")
    public ResponseDto selectCoupon(){

        List<Coupon> list = couponService.selectCoupon1();
        System.out.println(list+"------list----list---");
        if (list == null){
            return ResponseDto.fail();
        }
        return ResponseDto.ok(list);
    }



}
